% 创建时间：2025-06-21 12:56:22
% 作者：兪馳
clc;
clear;

A=[8,1,6;
    3,5,7;
    4,9,2];
B=[2,3;4,5];
C=-[1,2;3,4;5,6]
X=lyapsym(sym(A),B,C),
norm(A*X+X*B+C)

syms a real;
B=sym(B);
B(2,1)=a;
X=simplify(lyapsym(A,B,C)),
norm(A*X+X*B+C)
latex(X)